//
//  BoyeViewHandle.m
//  itboye2015002
//
//  Created by boye_mac1 on 15/8/18.
//  Copyright (c) 2015年 Boye. All rights reserved.
//

#import "BoyeViewHandle.h"

@implementation BoyeViewHandle

#pragma mark - 动画
/** 向右翻转 动画 */
+ (void)flipViewFromRight:(UIView *)view duration:(CGFloat)duration {
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
    [UIView setAnimationDuration:duration];
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:view cache:NO];
    [UIView commitAnimations];
}
/** 向左翻转 动画 */
+ (void)flipViewFromLeft:(UIView *)view duration:(CGFloat)duration {
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
    [UIView setAnimationDuration:duration];
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:view cache:NO];
    [UIView commitAnimations];
}


/** Frame 动画 */
+ (void)updateFrame:(UIView *)view toFrame:(CGRect)frame duration:(CGFloat)duration {
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
    [UIView setAnimationDuration:duration];
    view.frame = frame;
    [UIView commitAnimations];
}



#pragma mark - 视图操作
/** 创建线 */
- (UIView *)createLineInView:(UIView *)supview frame:(CGRect)frame color:(UIColor *)color {
    UIView *line =  [[UIView alloc] init];
    line.frame = frame;
    line.backgroundColor = color;
    [supview addSubview:line];
    return line;
}











@end
